package com.cyufeng.blog;

import com.cyufeng.blog.common.UserConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@SpringBootConfiguration
public class MySpringBootConfigurer extends WebMvcConfigurerAdapter {
    @Autowired
    UserConfig userConfig;

    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(userConfig).addPathPatterns("/**");

    }

}
